import { FormGroup } from '@angular/forms';
import { OnInit } from '@angular/core';
import { DomBase } from '../../dynamic/dom/dom-base';

export class DomFormComponent implements OnInit {
    dombases: DomBase<any>[];
    form: FormGroup;
    payLoad = '';

    ngOnInit() { }

    funInvalid(dombase: DomBase<any>) {
        return this.form.controls[dombase.key].invalid;
    }

    onSubmit() { 
        this.payLoad = JSON.stringify(this.form.value);
    } 
} 